package com.godofgamblers.hotelmanagementsystem.service.imp;

import com.godofgamblers.hotelmanagementsystem.dto.OrderItemDTO;
import com.godofgamblers.hotelmanagementsystem.mapper.Order_ItemMapper;
import com.godofgamblers.hotelmanagementsystem.pojo.Comment;
import com.godofgamblers.hotelmanagementsystem.pojo.Order_item;
import com.godofgamblers.hotelmanagementsystem.service.Order_ItemService;
import lombok.Data;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wzx
 * @date 2019/10/14 - 10:35
 */
@Service
@Transactional
@Data
public class OrderItemServiceImp implements Order_ItemService {
    @Resource
    private Order_ItemMapper order_itemMapper;

    @Override
    public void insertOrderItem(Order_item order_item) {
        order_itemMapper.insertOrderItem(order_item);
    }

    @Override
    public List<Order_item> findorderItemByOrderId(Integer order_id) {
        return order_itemMapper.findorderItemByOrderId(order_id);
    }

    @Override
    public void updateOrderItemState(Integer order_id) {
        order_itemMapper.updateOrderItemState(order_id);
    }

    @Override
    public void updateOrderItemStates(Integer order_id) {
        order_itemMapper.updateOrderItemStates(order_id);
    }

    @Override
    public List<OrderItemDTO> findDto(Integer user_id) {
        return order_itemMapper.findDto(user_id);
    }

    @Override
    public void updateOrderCommonState(Integer order_item_id) {
        order_itemMapper.updateOrderCommonState(order_item_id);
    }

    @Override
    public void insertCommon(Comment comment) {
        order_itemMapper.insertCommon(comment);
    }
}
